<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@include file="/WEB-INF/webpage/common/taglibs.jspf"%>
<!DOCTYPE html>
<html>
<head>
  <title>系统流程单据信息配置列表</title>
  <meta name="decorator" content="list"/>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <html:css  name="iCheck,Validform,jquery-ztree,easy-ui"/>
  <html:js  name="iCheck,Validform,jquery-ztree,easy-ui,public-js"/>
  <style type="text/css">.row{margin:0;}</style>
  <script type="text/javascript" src="${staticPath}/common/js/curdtools_jqgrid_extend.js"></script>
  <script type="text/javascript" src="${staticPath}/common/js/window.js"></script>
  <script type="text/javascript" src="${staticPath}/common/js/ztree.js"></script>
  <script type="text/javascript" src="${staticPath}/common/js/initSelect.js"></script>
</head>
<body title="系统流程单据信息配置">
<div class="easyui-layout" fit="true" style="width:100%;">
	<div data-options="region:'west',split:true" style="width:15%;" title="菜单树">
		 <div class="zTreeDemoBackground left">
			<ul id="ztree" class="ztree"></ul>
		</div>
	</div>
	<div data-options="region:'center'" title="系统流程单据信息配置">
		<grid:grid id="billActConfigGridId" url="${adminPath}/sys/billactconfig/ajaxList" 
			dbUrl="${adminPath}/sys/billactconfig/{id}" dialogWidth="70%" dialogHeight="80%">
			<grid:column label="sys.common.key" hidden="true"   name="id" width="100"/>
		    <grid:column label="菜单名称"  name="menuName" />
		    <grid:column label="表单地址"  name="formUrl" />
		    <grid:column label="主键字段"  name="idFeild" />
		    <grid:column label="状态字段"  name="statusFeild" />
		    <grid:column label="类型"  name="type" dict="billConfigType" />
		    <grid:column label="表名"  name="tableName" />
		    <grid:column label="类名"  name="className" />
		    <grid:column label="限时提交"  name="limitSubmit" formatter="date" dateformat="yyyy-MM-dd"/>
		    <grid:column label="是否自动提交"  name="isAutoSubmit" />
		    <grid:column label="允许类型"  name="allowType" dict="allowType"/>
		    <grid:column label="允许修改属性"  name="allowModifyProperty" />
			<grid:column label="sys.common.opt"  name="opt" formatter="button" width="100"/>
			<%-- <shiro:hasPermission name="sys:billactconfig:update "> --%>
				<grid:button title="sys.common.update"  groupname="opt" function="rowDialog" outclass="btn-success"
					  innerclass="fa-file-text-o" url="${adminPath}/sys/billactconfig/\"+row.id+\"/update" 
					  winwidth="70%" winheight="80%"/>
			<%-- </shiro:hasPermission>
			<shiro:hasPermission name="sys:billactconfig:create"> --%>
				<grid:toolbar function="create_" icon="fa-plus" btnclass="btn-fa-plus"  url="${adminPath}/sys/billactconfig/create"
					title="sys.common.create" winwidth="70%" winheight="80%"/>
			<%-- </shiro:hasPermission>
			<shiro:hasPermission name="sys:billactconfig:delete"> --%>
				<grid:toolbar function="delete"/>
			<%-- </shiro:hasPermission> --%>
			
			<grid:toolbar function="search"/>
			<grid:toolbar function="reset"/>
		</grid:grid>
	</div>
</div>
<script type="text/javascript">

var gridId = 'billActConfigGridIdGrid';
var treeObj = null;
var nodeId = null;

/**
 * @description 初始化加载js.<br>
 * @date 2018/8/27.<br>
 * @author zcg .<br>
 */
$(function(){
	var trees = '${trees}';
	trees = $.parseJSON(trees);
	treeObj = $.fn.zTree.init($("#ztree"), setting, trees);
});
 
/**
 * @description 左侧树的相关参数设置.<br>
 * @date 2018/2/24.<br>
 * @author zcg .<br>
 */ 
var setting = {
	callback: {
		onClick: zTreeOnClick
	}
}
 
/**
 * @description 点击左侧的树,触发搜索.<br>
 * @date 2018/2/24.<br>
 * @author zcg .<br>
 */
function zTreeOnClick(event, treeId, treeNode){
	nodeId = treeNode.id;
	search(gridId,{nodeId:nodeId});
}
 
/**
 * @description 新增业务单据信息配置.<br>
 * @date 2018/8/28.<br>
 * @author zcg .<br>
 */
function create_(title,url,gridId,width,height){
	 var rows = $("#"+gridId).jqGrid('getRowData');
	 if(!nodeId){
		layer.msg('请选择菜单',{icon:3,time:1000}); 
		return;
	 }
	 if(rows.length>0){
		 layer.msg('一张业务单据只能新增一条配置',{icon:3,time:1000}); 
		 return;
	 }
	 url = url+'?menuId='+nodeId;
	 create(title,url,gridId,width,height);
}
</script>
</body>
</html>